package poker_sim;


import java.awt.Dimension;
import javax.swing.JPanel;
import javax.swing.JTextField;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Rob
 */
public class SeatViewer extends JPanel
{
    JTextField name;
    JTextField score;
    Seat seat;
    public SeatViewer()
    {
        
        this.setLayout(null);
        this.setPreferredSize(new Dimension(100,50));
        //this.setPreferredSize(100, 75);
        name = new JTextField("Empty Seat");
        name.setSize(100, 25);
        name.setLocation(0, 0);
        this.add(name);
        score = new JTextField("");
        score.setSize(100, 25);
        score.setLocation(0, 25);
        this.add(score);
    }
    
    public void AttachSeat(Seat _seat)
    {
        seat = _seat;
    }
    
    public void Update()
    {
        name.setText(seat.Getname());
        score.setText(Integer.toString(seat.Getscore()));
    }
    
    public void Reset()
    {
        name.setText("Empty Seat");
        score.setText("");
    }
    
}
